<%--
  Created by IntelliJ IDEA.
  User: CY
  Date: 2018/1/4
  Time: 10:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>年度总分</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ? MYOA_CHARSET : htmlspecialchars($HTML_PAGE_CHARSET))?>" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="/css/street/street.css"/>
    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/pagination/style/pagination.css">
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <%--<link rel="stylesheet" type="text/css" href="/css/patrol/patrol.css"/>--%>
    <link rel="stylesheet" href="/css/base.css">

    <script src="../js/jquery/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/layer/layer.js?20201106" type="text/javascript" charset="utf-8"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/js/base/tablePage.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="../js/leader/WdatePicker.js"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <script src="/lib/layui/layui/layui.js"></script>
    <style>
        body{
            margin:0px;
        }
        .info{
            width:180px;
            height:28px;
            border-radius: 3px;
            margin-left:20px;
            vertical-align: middle;
        }
        button{
            background: #2f8ae3;
            margin-left: 10px;
            padding: 5px 10px;
            border-radius: 4px;
            color: #fff;
            cursor: pointer;
            font-size:14px;
        }
        #add{
            float:right;
            margin:0px 20px 0px 0px;
        }
        .table{
            width:96%;
            margin:5px auto 0px;
        }
        .tableFoot{
            margin-top:20px;
        }
        .childCheck{
            width:16px;
            vertical-align: middle;
        }
        #checkAll{
            margin-left:10px;
        }
        #outport{
            background: #cc0000;
        }
        #inportEdit{
            background: #009900;
        }
        .M-box3 .active{
            margin: 0px 3px;
            width: 29px;
            height: 29px;
            line-height: 29px;
            background: #2b7fe0;
            font-size: 12px;
            border: 1px solid #2b7fe0;
            color:#fff;
            text-align:center;
            display: inline-block;
        }
        .M-box3 a{
            margin: 0 3px;
            width: 29px;
            height: 29px;
            line-height: 29px;
            font-size: 12px;
            display: inline-block;
            text-align:center;
            background: #fff;
            border: 1px solid #ebebeb;
            color: #bdbdbd;
            text-decoration: none;
        }
        .mainBg .mainTitle{
            min-width: 750px;
        }
        .mainTitleUl .bordercolor span{
            font-size:14px;
        }
        .mainTitleUl .bordercolor label input[type=text]{
            font-size:14px;
        }
        .mainBg{
            padding-top:0px;
        }
        #houseProperty{
            background: none!important;
        }
        .WdateDiv .NavImg a {
            float: left;
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .WdateDiv .NavImgll a{
            background-position: 0px 1px;
        }
        .WdateDiv .NavImgrr a{
            background-position: -48px 0px;
        }
        .layui-form-label{
            width: 45px;
        }
    </style>
</head>
<body>
<div class="headTop">
    <div class="headImg">
        <img src="/img/document/icon_agentDispatch.png" alt="">
    </div>
    <div class="divTitle">
        年度积分
    </div>
</div>
<div class="content" style="padding-top:55px;">
    <div class="tableList" >
        <div class="headNav">
            <div class="layui-inline">
                <label class="layui-form-label">年份</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test2" placeholder="yyyy">
                </div>
            </div>
            <span><button type="button" class="layui-btn sear">查询</button></span>
<%--                <input type="text" id="year" style="width:180px;height:28px;border-radius: 3px;margin-left:20px;margin-bottom:10px;" class="Wdate" onclick="WdatePicker({onpicked:function(dq){ajaxPageLe.data.timeType=$('#year').val(); ajaxPageLe.page();},dateFmt:'yyyy'})">--%>
        </div>
        <div class="table">
            <table>
                <thead>
                <tr>
                    <th>党支部</th>
                    <th>党员</th>
                    <th>总分</th>
                </tr>
                </thead>
                <tbody class="list">

                </tbody>
            </table>

            <div style="margin: 0px auto 0px;height:50px;width: 97%;" class="clearfix">
                <div id="dbgz_page" class="M-box3" style="display: none">

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        //年选择器
        laydate.render({
            elem: '#test2',
            type: 'year',
        });

        var data = new Date()
        var years = data.getFullYear();
        //    分页列表
        console.log($('#test2').val())
        var ajaxPageLe={
            data:{
                page:1,//当前处于第几页
                pageSize:10,//一页显示几条
                useFlag:true,
                type:'year',
                timeType:years
                // computationNumber:null
            },
            page:function () {
                var id=$.GetRequest().id;
                if(id==undefined){
                    id=''
                }else{
                    id=id
                }
                var me=this;
                $.ajax({
                    url:'/integralManger/getDataByType?partyId='+id,
                    type:'get',
                    data:me.data,
                    dataType:'json',
                    success:function(reg){
                        var datas=reg.data;


                        var str="";
                        for(var i=0;i<datas.length;i++){
                            /*var imgL=datas[i].attachmentList;
                            var img=""
                            for(var h=0;h<imgL.length;h++){
                                img +=   '<img src="/xs?'+imgL[h].attUrl+'" alt="" onclick="javascript:window.open(this.src)" style="width: 40px;height: 40px;margin-right: 10px;">'
                            }*/
                            str+='  <tr >' +
                                //                            '                    <td>' +
                                //                            '                        <input type="checkbox" class="childCheck">' +
                                //                            '                    </td>' +
                                /*'                    <td>'+(i+1)+'</td>' +
                                '                    <td>'+datas[i].timeStr+'</td>' +*/
                                '                    <td>'+datas[i].partyBranchName+'</td>' +
                                '                    <td>'+function(){
                                    if(datas[i].partyMembers==undefined){
                                        return ''
                                    }else{
                                        return datas[i].partyMembers;
                                    }
                                }()+'</td>' +
                                '                    <td>'+datas[i].scoreTotal+'</td>' +
                                /*'                    <td>'+img+'</td>' +*/
                                /*'                    <td>' +
                                '                        <a href="javascript:;" class="choose" data-type="1">查看</a>' +
                                '                        <a href="javascript:;" class="choose" data-type="2">修改</a>' +
                                //                            '                        <a href="javascript:;" class="del">删除</a>' +
                                '                    </td>' +*/
                                '                </tr>'
                        }
                        $('.list').html(str);
                        if(reg.total>10){
                            $('#dbgz_page').show();
                            me.pageTwo(reg.total,me.data.pageSize,me.data.page)
                        } else {
                            $('#dbgz_page').hide();
                        }
                    }
                })

            },
            pageTwo:function (totalData, pageSize,indexs) {
                var mes=this;
                $('#dbgz_page').pagination({
                    totalData: totalData,
                    showData: pageSize,
                    jump: true,
                    coping: true,
                    homePage:'',
                    endPage: '',
                    current:indexs||1,
                    callback: function (index) {
                        mes.data.page=index.getCurrent();
                        mes.page();
                    }
                });
            }
        }
        ajaxPageLe.page();

        $(".sear").click(function(){
            ajaxPageLe.data.timeType=$('#test2').val();
            ajaxPageLe.data.type='year';
            ajaxPageLe.data.useFlag=true;
            ajaxPageLe.data.pageSize=10;
            ajaxPageLe.data.page=1;
            ajaxPageLe.page();
        });
    })

</script>
</body>
</html>
